package com.pikaqiu.warehouse.config;

import com.pikaqiu.warehouse.domain.common.ReqCommonParams;
import lombok.extern.slf4j.Slf4j;

/**
 * 上下文数据
 * @Author: Administrator
 * @Date: 2024/8/13
 */
@Slf4j
public class BaseContext {

    private static final ThreadLocal<ReqCommonParams> context = new ThreadLocal<>();

    public static void set(ReqCommonParams reqCommonParams) {
        log.info("设置上下文数据:{}", reqCommonParams);
        context.set(reqCommonParams);
    }

    public static ReqCommonParams get() {
        return context.get();
    }

    public static void remove() {
        context.remove();
    }
}
